package com.example.searchenginebackend.common;

import lombok.Data;

/**
 * 统一返回对象
 * @param <T> data类型
 */
@Data
public class Result<T> {
    private int code;
    private T data;
    private String message;

    public Result(int code, T data, String message) {
        this.code = code;
        this.data = data;
        this.message = message;
    }

    public Result(T data) {
        this.code = 200;
        this.data = data;
        this.message = "ok";
    }
}
